<template>
  <view class="market">
    <view class="header">
      <view class="header-left">
        <img
          src="../../static/images/market/head.png"
          alt=""
          class="head-img"
        />
        <text class="name">纳斯达克TRMD</text>
      </view>
      <tui-dropdown-list :show="dropdownShow" :top="94" :height="400">
        <template v-slot:selectionbox>
          <tui-icon name="arrowdown"></tui-icon>
        </template>
        <template v-slot:dropdownbox> 下拉列表内容 </template>
      </tui-dropdown-list>
    </view>
    <view class="container">
      <img src="../../static/images/market/buy.png" alt="" class="test" />
      <view class="pay-wrapper">
        <view class="pay-header">
          <text class="title">买入金额</text>
          <text
            class="rule"
            @click="linkTopages('/pagesA/marketRules/marketRules')"
            >锁仓规则说明</text
          >
        </view>
        <tui-input placeholder="最低买入100U">
          <template v-slot:left>
            <text class="icon_money">¥</text>
          </template>
        </tui-input>
        <tui-tag type="gray" plain shape="circle" margin="0 10rpx 0 0"
          >100U</tui-tag
        >
        <tui-tag type="gray" plain shape="circle" margin="0 10rpx 0 0"
          >500U</tui-tag
        >
        <tui-tag type="gray" plain shape="circle" margin="0 10rpx 0 0"
          >1000U</tui-tag
        >
        <tui-tag
          type="gray"
          plain
          shape="circle"
          margin="0 10rpx 0 0"
          @click="showCustomMoney"
          >自定义购入金额</tui-tag
        >
      </view>
      <view class="pay-method">
        <text class="pay-method-title">付款方式</text>
        <view
          class="pay-method-text"
          @click="linkTopages('/pagesA/rewardMechine/rewardMechine')"
        >
          充值U
          <img src="../../static/images/market/more.png" alt="" class="more" />
        </view>
      </view>
      <tui-form-item padding="0">
        <tui-form-button radiu="20">确认购买</tui-form-button>
      </tui-form-item>
    </view>
    <tui-modal :show="modal" custom>
      <view class="modal-custom">
        <view class="custom-content">
          <tui-input
            placeholder="请输入自定义金额"
            clearable
            v-model="name"
          ></tui-input>
        </view>
        <view class="btn-wrap">
          <tui-button
            height="72rpx"
            :size="28"
            shape="circle"
            plain
            margin="0 20rpx 0 0"
            @click="modal = false"
            >取消</tui-button
          >
          <tui-button
            height="72rpx"
            :size="28"
            shape="circle"
            type="primary"
            @click="handleClick"
            >确定</tui-button
          >
        </view>
      </view>
    </tui-modal>
  </view>
</template>

<script>
export default {
  data() {
    return {
      name: "",
      modal: false,
      dropdownShow: false,
    };
  },
  methods: {
    linkTopages(url) {
      uni.navigateTo({
        url: url,
        // url:"/pagesA/marketRules/marketRules"
        // url:"/pagesA/rewardMechine/rewardMechine"
      });
    },
    showCustomMoney() {
      this.modal = true;
    },
    handleClick() {},
  },
  onShow() {
    this.tui.linkToLogin();
  },
};
</script>

<style scoped lang="scss">
.market {
  padding: 30rpx 30rpx 150rpx 30rpx;
}
.header {
  display: flex;
  justify-content: space-between;
}
.header-left {
  display: flex;
  align-items: center;
}
.head-img {
  width: 50rpx;
  height: 50rpx;
  vertical-align: middle;
}
.name {
  font-size: 30rpx;
  color: #202327;
  margin-left: 20rpx;
}
.container {
  min-height: 100%;
  // background: orange;
}
.test {
  margin: 24rpx auto;
  width: 690rpx;
  height: 621rpx;
}
.pay-wrapper {
  background: #fff;
  padding: 20rpx;
  border-radius: 7rpx;
}
.pay-wrapper::v-deep.tui-input__wrap {
  padding: 13px 0px !important;
}
.pay-header {
  display: flex;
  justify-content: space-between;
}
.pay-header .title {
  font-weight: 600;
  font-size: 26rpx;
  color: #202327;
}

.pay-header .rule {
  font-size: 24rpx;
  color: #31d49d;
}
.icon_money {
  font-weight: 600;
  font-size: 42rpx;
  color: #202327;
  padding-right: 24rpx;
}
.pay-method {
  display: flex;
  justify-content: space-between;
  margin: 50rpx 0 125rpx 0;
  background: #fff;
  padding: 27rpx 20rpx;
}
.pay-method-title {
  font-weight: 600;
  font-size: 26rpx;
  color: #202327;
}
.pay-method-text {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24rpx;
  color: #c2c2c2;
  margin-right: 10rpx;
}
.more {
  width: 30rpx;
  height: 30rpx;
}
.btn-wrap {
  display: flex;
  justify-content: space-between;
  margin-top: 40rpx;
}
.btn-wrap::v-deep.tui-primary-outline {
  color: var(--theme-color) !important;
}
.btn-wrap::v-deep.tui-btn-primary {
  background: var(--theme-color) !important;
}
.btn-wrap::v-deep.tui-button__border {
  border-color: var(--theme-color) !important;
}
.custom-content {
  border-bottom: 1px solid #c6c6c6;
}
.custom-content::v-deep.uni-input-placeholder {
  text-align: center;
}
.custom-content::v-deep.uni-input-input {
  text-align: center;
}
.modal-custom {
  margin: 60rpx 0 40rpx 0;
}
</style>
